package org.example.mapper;

import org.apache.ibatis.annotations.MapKey;
import org.apache.ibatis.annotations.Param;
import org.example.dao.Employee;

import java.util.List;
import java.util.Map;

public interface EmployeeMapper {
    List<Employee> findAllEmployee();

    void addEmployee(Employee employee);

    void delEmployee(int id);

    int updateEmployee(Employee employee);

    Employee findEmployeeById(int id);

    // 返回map集合
    @MapKey("empId")
    Map<Integer, Employee> mapSelectAll();

    Map<String, Employee> mapSelectOne(Integer id);

    Employee mapSelectDeptOne(Integer id);

    // 通过部门id获取员工信息
    List<Employee> getListByDeptId(Integer deptId);

    // 多条件查询
    List<Employee> getListParam(@Param("id") Integer id, @Param("name") String name);
    List<Employee> getListParamPOJO(Employee employee);


}
